import {executeSQL} from '../sqlite.js'
//轮播图初始化
export const initBannerTable = async () => {
  const sql = `
    CREATE TABLE IF NOT EXISTS banner (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      image TEXT,
      created_at INTEGER DEFAULT (strftime('%s','now')),
    );`
  await executeSQL(sql)
  
  // 2025年新增的图片压缩优化索引 
  await executeSQL(`
    CREATE INDEX IF NOT EXISTS idx_banner_compression 
    ON banner(format, size) WHERE size > 1048576 
  ;`)
} 